<#-- @ftlvariable name="students" type="java.util.List<model.Student>" -->
<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>主题列表</title>
</head>
<body>
<#if (session.user)??>

<a href="/topic/topic_add">添加</a>
<form action="/topic/topic_modify" method="post">
<table border="1" cellspacing="0">
    <thead>
    <tr>
        <th>Title</th>
        <th>Pub_date</th>
        <th>Operation</th>
    </tr>
    </thead>
    <tbody>
    <#list topics as topic>
    <tr>
        <input name="id" type="hidden" value="${topic.id}">
        <td> ${topic.title}</td>
        <td> ${topic.pub_date}</td>
        <td><a href="/topic/topic_modify?id=${topic.id}">修改</a>|<a href="/topic/topic_delete?id=${topic.id}">删除</a></td>
    </tr>
    </#list>
    </tbody>
</table>
</form>

<#else>
            <span style="color:red;">请<a href="/login">登录</a>后再修改</span>
</#if>

</body>
</html>